package com.yc.sole.system.request;

import com.yc.sole.common.enums.CommonState;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.util.List;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2023-03-26
 **/
@Data
public class UserReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 用户名
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String username;
    /**
     * 密码
     */
    /*@NotBlank(groups = SaveGroup.class)
    @Length(min = 6, max = 18, groups = {SaveGroup.class, UpdateGroup.class})
    private String password;*/
    /**
     * 手机
     */
    @Length(max = 20, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String phoneNum;
    /**
     * 邮箱
     */
    @Email(groups = {SaveGroup.class, UpdateGroup.class})
    private String email;
    /**
     * 状态
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private CommonState state;
    /**
     * 角色id
     */
    @NotEmpty(groups = {SaveGroup.class, UpdateGroup.class})
    private List<Long> roleIds;
    /**
     * 部门id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long deptId;
}
